﻿using System;
using Windows.UI.Xaml.Data;

namespace Antares.Converters
{
    public class TaskToShortInfoConverter : IValueConverter
    {
        readonly IntToShortTimeConverter _its = new IntToShortTimeConverter();
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value == null)
            {
                return null;
            }
            // ReSharper disable AssignNullToNotNullAttribute
            return parameter == null
                       ? "??? - " + value
                       : _its.Convert((int)parameter, null, null, null) + " - " + value;
            // ReSharper restore AssignNullToNotNullAttribute
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
